﻿using System.Collections.Generic;
using System.Data.Entity;

namespace Stadsetjarinn.Models
{
    public class LocalDeviceDataDatabaseInitializer : DropCreateDatabaseIfModelChanges<DataContext>
    {
        protected override void Seed(DataContext context)
        {
            GetLocalDeviceData().ForEach(c => context.Local_Device_Data.Add(c));
            GetRecievedDeviceData().ForEach(c => context.Recieved_Device_Data.Add(c));
            GetDeviceGroup().ForEach(c => context.Device_Groups.Add(c));
            GetDeviceGroup().ForEach(c => context.Device_Groups.Add(c));
        }

        private static List<Local_Device_Data> GetLocalDeviceData()
        {
            var Data = new List<Local_Device_Data> 
            {
                new Local_Device_Data
                {
                    Device_ID = 1
                },
                new Local_Device_Data

                {
                     Device_ID = 2
                }
            };
            return Data;
        }
        private static List<Recieved_Device_Data> GetRecievedDeviceData()
        {
            var Data = new List<Recieved_Device_Data> 
            {
                new Recieved_Device_Data
                {
                    Send_ID = 1
                }
            };
            return Data;
        }
        private static List<Device_Groups> GetDeviceGroup()
        {
            var Data = new List<Device_Groups> 
            {
                new Device_Groups
                {
                    Group_ID = 1
                }
            };
            return Data;
        }
        private static List<Registration_Data> GetRegistrations()
        {
            var Data = new List<Registration_Data> 
            {
                new Registration_Data
                {
                    Registration_ID = 1
                }
            };
            return Data;
        }
    }
}